package com.halflife.parameter.template;

import com.halflife.framework.generator.annotation.Join;
import com.halflife.framework.generator.annotation.QueryAnn;
import com.halflife.framework.generator.build.SimpleBuilder;
import com.halflife.framework.generator.build.UpdataBuilder;
import com.halflife.framework.participant.user.UserView;
import org.junit.jupiter.api.Test;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@QueryAnn(title = "Templates",mainTitle = "Templates",table = "t_parameter_templates_image")
public class TemplateImage {
    @Test
    public void generate0()throws Exception{
        SimpleBuilder builder = new SimpleBuilder();
        builder.buildRepository(this.getClass());
//        builder.buildMapper(this.getClass());
//        builder.buildCreateTable(this.getClass());
//        builder.buildAll(this.getClass());
    }
    @Test
    public void generate()throws Exception{
        UpdataBuilder builder = new UpdataBuilder();
//        builder.buildMapper(this.getClass());
        builder.buildAlterTable(this.getClass());
    }
    private Integer id;
    @QueryAnn(value = "name")
    private String name;
    @QueryAnn(value = "code")
    private String code;
    @QueryAnn(value = "url")
    private String url;
    @QueryAnn(value = "valid")
    private Boolean valid;
    @QueryAnn(value = "templateId")
    private Integer templateId;
    public void init(){
//        SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
        this.valid = true;

    }

    public Integer getTemplateId() {
        return templateId;
    }

    public void setTemplateId(Integer templateId) {
        this.templateId = templateId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Boolean getValid() {
        return valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }
}
